package com.ruoyi.framework.util;

import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;

public class LoginUserUtil {

    public static LoginUser getLoginUser()
    {
        LoginUser loginUser = SecurityUtils.getLoginUser();
        if (StringUtils.isNull(loginUser))
        {
            loginUser = new LoginUser();
        }
        return loginUser;
    }

    public static SysUser getSysUser()
    {
        return SecurityUtils.getLoginUser().getUser();
    }

    public static String getChannelCode()
    {
        return SecurityUtils.getLoginUser().getChannelCode();
    }
}
